home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** Program: MacShell
- ** File: start.c
- ** Originally from: Traffic Light 2.0 (2.0 version by Keith Rollin)
- ** Modified by: Eric Soldan
- **
- ** Copyright © 1989-1991 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /*****************************************************************************/
-
-
-
- #define declare_main_structs
-
- #include "MacShell.h" /* Get the MacShell includes/typedefs, etc. */
- #include "MacShellCommon.h" /* Get the stuff in common with rez. */
- #include "MacShell.protos" /* Get the prototypes for MacShell. */
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
-
- /*****************************************************************************/
-
-
-
- #ifndef THINK_C
- extern void _DataInit();
- #endif
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- #pragma segment Main
- void main(void)
- {
- #if MACSHELL_VERSION
- NamesTableEntry appNTE;
- EntityName appEntityName;
- OSErr atErr;
- #endif
-
- #ifndef THINK_C
- UnloadSeg((Ptr)_DataInit); /* Note that _DataInit can't be in Main! */
- #endif
-
- /* If you have stack requirements that differ from the default, then you
- ** could use SetApplLimit to increase StackSpace at this point, before
- ** calling MaxApplZone.
- */
-
- MaxApplZone(); /* Expand the heap so code segments load at the top. */
-
- Initialize(); /* Initialize the program. */
- DoSetCursor(*GetCursor(watchCursor)); /* Rest of startup may take a while. */
-
- StartDocuments(); /* Open (or print) designated documents. */
-
- UnloadSeg((Ptr)Initialize); /* Initialize can't be in Main! */
-
- #if MACSHELL_VERSION
- atErr = AddPPCNBPAlias(&appNTE, "\pMacShell", &appEntityName);
- #endif
-
- EventLoop(); /* Call the main event loop. */
-
- #if MACSHELL_VERSION
- if (!atErr) RemoveNBPAlias(&appEntityName);
- #endif
-
- ExitToShell(); /* Quit the application. */
- }
-
-
-
-